package com.play.game.mymvp.presenter;

import com.play.game.mymvp.Bean;
import com.play.game.mymvp.model.GrilModel;
import com.play.game.mymvp.model.IGrilModel;
import com.play.game.mymvp.view.IGirlView;

import java.util.List;

/**
 * Created by 聪明一只哈 on 2018/4/11.
 * Time: 2018/4/11  12:34
 */

public class GrilPresenter<T extends IGirlView> extends BasePresenter<T>{

   // IGirlView grilview;



    IGrilModel grilModel=new GrilModel();


    /*public GrilPresenter(T grilview) {
        //this.grilview = grilview;
       // mVIewRef=new WeakReference<T>(grilview);
    }*/



    public void fetch(){
        if(mVIewRef.get()!=null){
            mVIewRef.get().showLoading();
            if (grilModel!=null){
                grilModel.loadGrild(new IGrilModel.GrilOnLoadListener() {
                    @Override
                    public void onComplete(List<Bean.DataBean> list) {
                        if(mVIewRef.get()!=null){
                            mVIewRef.get().showGrils(list);
                        }
                    }
                });
            }
        }


    }
}
